<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      >
    <ui:composition template="Template.xhtml">
        <ui:define name="top">
            #{bundle.create}#{bundle.vehicle}

        </ui:define>
        <ui:define name="content">
            <!--<shiro:hasPermission name="user:C">--> 

            <f:event listener="#{vehicleCreateMB.precreateVehicle()}"
                     type="preRenderView"></f:event>
            <h:form id="form"  >

                <p:panel>


                    <p:panelGrid styleClass="noborder left" columns="2"   >


                        <h:outputText value="#{bundle.plate}" />
                        <p:inputText value="#{vehicleCreateMB.currentVehicle.plate}"   required="true" requiredMessage="#{bundle.pleaseInput}#{bundle.plate}"/>
                        <h:outputText value="#{bundle.depot}" />
                        <p:selectOneMenu id="depot" value="#{vehicleCreateMB.currentVehicle.iddepot}" converter="#{depotConvert}">

                            <f:selectItems var="depot" value="#{vehicleCreateMB.depotList}" itemValue="#{depot}" itemLabel="#{depot.name}"/>
                        </p:selectOneMenu>

                        <h:outputText value="#{bundle.capacity}" />
                        <p:inputText value="#{vehicleCreateMB.currentVehicle.capacity}" required="true" requiredMessage="#{bundle.pleaseInput}#{bundle.capacity}"  />

                        <h:outputText value="#{bundle.perdispatchCost}" />
                        <p:inputText value="#{vehicleCreateMB.currentVehicle.dispatchCost}"   required="true" requiredMessage="#{bundle.pleaseInput}#{bundle.perdispatchCost}"/>

                        <h:outputText value="#{bundle.unitTranCost}" />
                        <p:inputText    value="#{vehicleCreateMB.currentVehicle.unitTranCost}"  required="true" requiredMessage="#{bundle.pleaseInput}#{bundle.unitTranCost}"/>
                        <h:outputText value="#{bundle.speed}" />
                        <p:inputText    value="#{vehicleCreateMB.currentVehicle.speed}"  required="true" requiredMessage="#{bundle.pleaseInput}#{bundle.speed}"/>



                        <p:commandButton value="#{bundle.conform}" validateClient="true" action="#{vehicleCreateMB.create()}"  update=":growl">
                            <p:confirm header="#{bundle.conform}" message="#{bundle.conform}" icon="ui-icon-alert" />
                        </p:commandButton>

                    </p:panelGrid>

                    <p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
                        <p:commandButton value="#{bundle.yes}" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
                        <p:commandButton value="#{bundle.no}" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
                    </p:confirmDialog>
                </p:panel>
            </h:form>





            <div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;" address=""></div>
            <!--</shiro:hasPermission>-->
        </ui:define>
    </ui:composition>
</html>

